import https from '../../request'

// 角色列表
export const getroleslist = () => https.get('roles')

// 权限列表
export const getrightslist = () => https.get('rights/list')

// 分配权限
export const getrightlist = () => https.get('rights/tree')

// 确认分配
export const editrightlist = (params) => https.post(`roles/${params.id}/rights`, { rids: params.rids })

// 添加角色
export const addrightlist = (params) => https.post('roles', params)

// 删除角色
export const delrightlist = (params) => https.delete(`roles/${params}`)

// 编辑角色
export const editrightslist = (params) => https.put(`roles/${params.id}`, params)

// 删除角色权限
export const deleteright=(params)=>https.delete(`roles/${params.id}/rights/${params.rid}`)